home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Suzy B Software 2
/
Suzy B Software CD-ROM 2 (1994).iso
/
new_file
/
falcon
/
dsptrack
/
dsptrack.lzh
/
TEMPODSP.GFA
(
.txt
)
< prev
next >
Wrap
GFA-BASIC Atari
|
1994-06-17
|
1KB
|
49 lines
'
' Génération de la table des tempos pour la routine soundtracker DSP
'
DIM tablo%(255-32)
adr%=V:tablo%(0)
'
FOR tempo&=32 TO 255
'
freq#=50/125*tempo&
'
frq#=500
frq#=@search_frq(1,4)
frq#=@search_frq(2,10)
frq#=@search_frq(3,16)
frq#=@search_frq(4,50)
frq#=@search_frq(5,64)
frq#=@search_frq(6,100)
frq#=@search_frq(7,200)
'
realfreq#=frq#/4
sample_length&=ROUND(49169/realfreq#)+1
'
PRINT USING " ### ###.## #### ###.## ###.## ### ### ",tempo&,freq#,sample_length&,realfreq#,frq#,timer_control&,timer_data&
~INP(2)
'
WORD{adr%}=sample_length&
BYTE{adr%+2}=timer_control&
BYTE{adr%+3}=timer_data&
adr%=adr%+4
'
NEXT tempo&
'
BSAVE "TEMPODSP.TAB",V:tablo%(0),4*(255-32)
'
FUNCTION search_frq(tmr_ctrl&,prediv&)
'
freq_div#=2.4576E+06/prediv&
tmr_data&=freq_div#/(4*freq#)
newfrq#=2.4576E+06/prediv&/tmr_data&
'
IF tmr_data&<256 AND ABS(newfrq#-freq#)<ABS(frq#-freq#) THEN
timer_control&=tmr_ctrl&
timer_data&=tmr_data&
RETURN newfrq#
ELSE
RETURN frq#
ENDIF
ENDFUNC